package org.travel.travel2gether.domain;

import java.util.List;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

@Entity
@SuppressWarnings("serial")
public class Car extends BaseEntity {
	private String brand;
	private String model;
	
	@Length(max = 1000)
	@Column(name = "ADDITIONAL_INFO")
	private String additionalInfo;
	
	@ElementCollection
	@CollectionTable(name = "CAR_IMAGE", joinColumns = @JoinColumn(name = "OWNER_ID"))
	@Column(name = "IMAGE_KEY")
	private List<String> imageKeys;

	@ManyToOne
	@NotNull
	private Account account;
	
	@OneToMany(mappedBy = "car")
	private List<Track> tracks;
	
	public List<String> getImageKeys() {
		return imageKeys;
	}

	public void setImageKeys(List<String> imageKeys) {
		this.imageKeys = imageKeys;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getAdditionalInfo() {
		return additionalInfo;
	}

	public void setAdditionalInfo(String additionalInfo) {
		this.additionalInfo = additionalInfo;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public List<Track> getTracks() {
		return tracks;
	}

	public void setTracks(List<Track> tracks) {
		this.tracks = tracks;
	}

}
